#![cfg_attr(docsrs, feature(doc_cfg))]

pub mod response;
pub mod error;
pub mod backtrace_filter;

#[cfg(feature = "panic")]
pub mod middleware;

#[cfg(feature = "logging")]
pub mod logging;

pub mod prelude {
    pub use crate::app_error;
    pub use crate::error::{AppError, ContextExt, ResultExt};
    pub use crate::response::{AppResult, Response};
    pub use crate::backtrace_filter::BacktraceFilter;

    #[cfg(feature = "panic")]
    pub use crate::middleware::panic::{catch_panic_middleware, setup_panic_hook};

    #[cfg(feature = "logging")]
    pub use crate::logging::{setup_tracing, LoggingConfig};
}

pub use error::AppError;
pub use response::{AppResult, Response};

#[macro_use]
mod macros;
